package com.cwj;

public class BitTrie {
    static int[][] ch;
    static int[] num;
    static int cnt = 0;

    public static void insert(int val) {
        int u = 0;
        for (int i = 31; i >= 0; i--) {
            int bit = (val >> i) & 1;
            if (ch[u][bit] == 0) {
                ch[u][bit] = ++cnt;
            }
            u = ch[u][bit];
        }
        num[u] = val;
    }
}
